home *** CD-ROM | disk | FTP | other *** search
/ MacHack 2000 / MacHack 2000.toast / pc / The Hacks / Softshoe / Lisa's Mac Parts / Views / View Options / DrawsSpontaneously.cp < prev    next >
Text File  |  2000-06-23  |  1KB  |  54 lines

  1. // DrawsSpontaneously.cp
  2.  
  3. #ifndef DrawsSpontaneously_h
  4. #include "DrawsSpontaneously.h"
  5. #endif
  6. #ifndef ValidAndInvalidCanvasLoop_h
  7. #include "ValidAndInvalidCanvasLoop.h"
  8. #endif
  9. #ifndef InvalidCanvasLoop_h
  10. #include "InvalidCanvasLoop.h"
  11. #endif
  12. #ifndef CellUpdater_h
  13. #include "CellUpdater.h"
  14. #endif
  15. #ifndef Pane_h
  16. #include "Pane.h"
  17. #endif
  18.  
  19. DrawsSpontaneously::~DrawsSpontaneously()
  20.   {
  21.     while ( !panes.IsEmpty() )
  22.         (*panes.Last())->Clear();
  23.   }
  24.  
  25. void DrawsSpontaneously::Invalidate() const
  26.   {
  27.     for ( ValidAndInvalidCanvasLoop canvas( *this );
  28.             canvas.Unfinished();
  29.             canvas++ )
  30.         canvas->Invalidate();
  31.   }
  32.  
  33. void DrawsSpontaneously::Redraw()
  34.   {
  35.     for ( ValidAndInvalidCanvasLoop canvas( *this );
  36.             canvas.Unfinished();
  37.             canvas++ )
  38.       {
  39.         Deliver( CellUpdater( canvas->Clip() ), *canvas );
  40.         canvas->Validate();
  41.       }
  42.   }
  43.  
  44. void DrawsSpontaneously::Update()
  45.   {
  46.     for ( InvalidCanvasLoop canvas( *this );
  47.             canvas.Unfinished();
  48.             canvas++ )
  49.       {
  50.         Deliver( CellUpdater( canvas->Clip() ), *canvas );
  51.         canvas->Validate();
  52.       }
  53.   }
  54.